package com.systop.student.mapper;

import com.systop.common.pojo.student_elective;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;


import java.util.List;

@Mapper
public interface student_electiveMapper {
//    private Integer student_elective_id;//主键id
//    private String sno;//学号
//    private Integer elective_course_id;//排课id
//    private String student_name;//学生姓名
//    private Date time_stamp;//时间戳24小时
//    private String remark;//备注
    //sno,elective_course_id,student_name,time_stamp,remark

    /*
     * 添加
     * Teacher
     * return int
     * csh
     * */
    @Insert("insert into student_elective(sno,elective_course_id,student_name,time_stamp,remark) values (#{sno},#{elective_course_id},#{student_name},#{time_stamp},#{remark})")
    int studentAdd(student_elective s);

    /*
     * 删除
     * csh
     * */
    @Delete("delete from student_elective where student_elective_id=#{student_elective_id}")
    int delStudent(int student_elective_id);

    /*
     * 查看全部
     * csh
     * */
    @Select("select * from student_elective where  sno=#{sno}")
    List<student_elective> studentSupList(String sno);

    /*
     * 通过排课id查询选课表
     * csh
     * */
    @Select("select * from student_elective where  elective_course_id=#{elective_course_id}")
    List<student_elective> studentSelective_course_id(int elective_course_id);
}
